<template>
  <div class="chat-item">
      <div class="avatar">
          <img :src="avatar" alt="">
      </div>
      <div class="content">
          <span class="name">{{ name }}</span>
          <span class="options">{{ options }}</span>
      </div>
      <div class="other">
          <span class="time">{{ time }}</span>
          <span class="disabled"></span>
      </div>
  </div>
</template>

<script>
export default {
    name: 'chat-item',
    props: {
        avatar: {
            type: String,
            required: true,
        },
        name: {
            type: String,
            required: true,
        },
        options: {
            type: String,
            required: true,
        },
        time: {
            type: String,
            required: true,
        }
    }
}
</script>

<style scoped>
.chat-item {
    width: 100%;
    height: 68px;
    background-color: rgb(254, 255, 255);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgb(218, 220, 220);
}
.chat-item > .avatar {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-item > .avatar > img {
    width: 60%;
    height: 60%;
}
.chat-item > .content {
    width: 100%;
    height: 70%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
.chat-item > .content > .name {
    font-size: 15px;
    font-weight: 500;
}
.chat-item > .content > .options {
    text-overflow: ellipsis;
    font-size: 13px;
    display: block;
    width: calc(100vw - 116px);
    overflow: hidden;
    white-space: nowrap;
    color: rgb(180, 180, 182);
}
.chat-item > .other {
    width: 32px;
    height: 100%;
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}
.chat-item > .other > .time {
    font-size: 13px;
    color: rgb(180, 180, 182);
}

</style>